package huawei.js2025;

import java.util.Scanner;

/**
 * 无向图染色
 */
public class Question32 {

    static int[][] graph;

    public static void main(String[] args) {
        Scanner sc = new Scanner(System.in);
        int M = sc.nextInt();
        int N = sc.nextInt();

        if (M == 0) {
            System.out.println(0);
            return;
        }

        graph = new int[M + 1][M + 1];

        for (int i = 0; i < N; i++) {
            int p1 = sc.nextInt();
            int p2 = sc.nextInt();
            graph[p1][p2] = 1;
            graph[p2][p1] = 1;
        }

        int[] color = new int[M + 1]; // 0 表示没有染色 1表示红 2 表示黑色

        int count = fillColor(color, 1);
        System.out.println(count);
    }

    private static int fillColor(int[] color, int i) {
        if (i >= graph.length) {
            return 1;
        }

        // 染红 检查相邻的节点是否染成了红色
        int[] neighbor = graph[i]; // 相邻的节点

        boolean hasRed = false;
        for (int j = 1; j < neighbor.length; j++) {
            if (neighbor[j] == 1 && color[j] == 1) {
                // 相邻节点被染成红色了
                hasRed = true;
                break;
            }
        }

        int count = 0;
        if (hasRed) {
            color[i] = 2; // 只能染成黑色
            count += fillColor(color, i + 1);
        } else {
            color[i] = 1; // 染红
            count += fillColor(color, i + 1);
            color[i] = 2; // 染黑
            count += fillColor(color, i + 1);
        }
        return count;
    }
}
